package cn.tedu.weibo.mapper;


import cn.tedu.weibo.entity.Weibo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WeiboMapper {
    @Insert("insert into weibo values(null,#{title},#{content}" +
            ",#{url},#{author},#{created},#{userId})")
    void insert(Weibo weibo);

    @Select("select id,title,url,author from weibo")
    List<Weibo> select();

    @Select("select id,title,content,url,author,created from weibo where id=#{id}")
    Weibo selectById(int id);
}

